/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		time_period_interface.hpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date: 2020-02-21 04:04
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-02-28 03:41
*
*   Description:
*
=============================================================================*/
#ifndef ITIMEPERIOD_H
#define ITIMEPERIOD_H

#include "../types.hpp"

namespace geoxfem {
namespace model {

struct ITimePeriod {
  ITimePeriod() = default;
  ITimePeriod(const _real& st, const _real& during)
                        : m_startTime{st}, m_endTime{st + during} {}
  ITimePeriod(const ITimePeriod&) = default;
  ITimePeriod(ITimePeriod&&)      = default;
  virtual ~ITimePeriod()          = default;
  ITimePeriod& operator=(const ITimePeriod&) = default;
  ITimePeriod& operator=(ITimePeriod&&) = default;

  /** get start time of this step
   *
   * @return
   */
  _real getStartTime() const {
    return m_startTime;
  }

  /** get start time of this step
   *
   * @return
   */
  _real getEndTime() const {
    return m_endTime;
  }

  /** get start time of this step
   *
   * @return
   */
  _real getDurationTime() const {
    return m_endTime - m_startTime;
  }

private:
  _real m_startTime;
  _real m_endTime;
};

}  // namespace model
}  // namespace geoxfem
#endif /* ITIMEPERIOD_H */
